home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-13 / emacs16d.zip / _RECTANG.MIN < prev    next >
Text File  |  1991-07-19  |  4KB  |  195 lines

  1.  
  2.  
  3.  
  4. Name:F:clear-rectangle
  5. Blank the rectangle spanned by point and mark.
  6. [*]#(Frectangle,clear)[*]
  7.  
  8.  
  9. Name:F:copy-region-to-rectangle
  10. [*]#(Fget-register,Copy to register,(
  11.     #(Ffree-register,#(reg.ARG1))
  12.     #(ds,reg.ARG1,R(,)##(go,reg.marks))
  13.     #(ds,old-buffer,##(ba,-1))
  14.     ##(ba,1,a)
  15.     #(sp,#(Fsecond,#(reg.ARG1))>)
  16.     #(dm,##(bc,##(++,##(bc,#(Fsecond,#(reg.ARG1))),1),d,a))
  17.     ##(ba,##(old-buffer))
  18.     #(pm,1)
  19.     #(ds,corners,#(Fcorners))
  20.     #(Fcopy-region-to-rectangle-do,#(corners),
  21.             ##(bc,#(Fsecond,#(reg.ARG1))))
  22.     #(pm)
  23. ))[*]
  24.  
  25.  
  26. Name:F:delete-rectangle
  27. Delete the rectangle spanned by point and mark.
  28. [*]#(Frectangle,delete)[*]
  29.  
  30.  
  31. Name:F:kill-rectangle
  32. Kill the rectangle spanned by point and mark.
  33. (can be yanked with M-x yank-rectangle)
  34. [*]#(ds,rectangle-buffer,#(Frectangle,kill))[*]
  35.  
  36.  
  37. Name:F:open-rectangle
  38. Insert a blank rectangle into the one spanned by point and mark.
  39. [*]#(Frectangle,open)[*]
  40.  
  41.  
  42. Name:F:yank-rectangle
  43. Insert the previously killed rectangle.
  44. [*]#(ds,column,##(lv,cs))
  45. #(Fyank-rectangle-do)
  46. [*]
  47.  
  48.  
  49. Name:Fclear-rectangle-do
  50. Called with arg1 = top, arg2 = left, arg3 = bot, arg4 = right.
  51. [*]#(Frectangle-do,(
  52.     #(dm,0)
  53.     #(Fpad-to-column,(arg4))
  54. ),(arg1),(arg2),(arg3),(arg4))[*]
  55.  
  56.  
  57. Name:Fcopy-region-to-rectangle-do
  58. arg1 = top
  59. arg2 = left
  60. arg3 = bot
  61. arg4 = right
  62. arg5 = (decimal) Mark in buffer one: write rectangle here.
  63. [*]#(sv,cl,(arg1))#(sv,cs,(arg4))
  64. #(sm,0)#(sv,cs,(arg2))
  65. #(SELF-do,(arg5),##(--,##(--,(arg4),(arg2)),##(nc,##(rm,0))))
  66. #(==,(arg1),(arg3),,(
  67.     #(SELF,#(++,(arg1),1),(arg2),(arg3),(arg4),(arg5)))
  68. ))[*]
  69.  
  70.  
  71. Name:Fcopy-region-to-rectangle-do-do
  72. arg1 = (decimal) Mark in buffer one: append the next line
  73.        (point to mark 0) here.
  74. arg2 = # blanks to pad at end of line.
  75. ##(old-buffer) contains the number of the buffer we're reading from.
  76. [*]##(ba,1,a)
  77. #(sp,##(bc,##(++,(arg1),1),d,a))
  78. #(bi,##(old-buffer),0)
  79. #(is,#(Floop, ,arg2)(
  80. ))
  81. ##(ba,##(old-buffer))
  82. [*]
  83.  
  84.  
  85. Name:Fdelete-rectangle-do
  86. Called with arg1 = top, arg2 = left, arg3 = bot, arg4 = right.
  87. [*]#(Frectangle-do,(
  88.     #(dm,0)
  89. ),(arg1),(arg2),(arg3),(arg4))[*]
  90.  
  91.  
  92. Name:Finsert-rectangle
  93. arg1 = (ascii) mark in buffer one: start of region to restore as rectangle
  94. arg2 = left column
  95. [*]#(ds,old-buffer,##(ba,-1))
  96. ##(ba,1,a)
  97. #(sp,arg1>)
  98. ##(ba,##(old-buffer))
  99. #(SELF-do,##(bc,##(++,##(bc,arg1),1),d,a),##(lv,cs))
  100. [*]
  101.  
  102.  
  103. Name:Finsert-rectangle-do
  104. arg1 = (ascii) mark in buffer one: end of region to restore as rectangle.
  105. arg2 = left column
  106. ##(old-buffer) contains the number of the buffer we're writing to.
  107. [*]#(==,#(..,##(ba,1,a))##(rc,arg1)#(..,##(ba,##(old-buffer))),0,,(
  108.     #(sv,cs,arg2)
  109.     #(Fpad-to-column,arg2)
  110.     #(bi,1,$)
  111.     #(sp,$)
  112.     #(==,##(rc,>),0,(
  113.         #(Fcrlf)
  114.     ),(
  115.         #(sp,>)
  116.     ))
  117.     ##(ba,1,a)
  118.     #(sp,$>)
  119.     ##(ba,##(old-buffer))
  120.     #(SELF,arg1,arg2)
  121. ))[*]
  122.  
  123.  
  124. Name:Fkill-rectangle
  125. Call this with arg1,arg2 = line,column of point, arg3,arg4 = line,column of mark.
  126. Call SELF-do with arg1 = top, arg2 = left, arg3 = bot, arg4 = right.
  127. [*]#(g?,arg3,arg1,(
  128.     #(g?,arg4,arg2,(
  129.         #(ds,rectangle-buffer)
  130.         #(pm,1)
  131.         #(SELF-do,arg1,arg2,arg3,arg4)
  132.         #(pm)
  133.     ),(
  134.         #(SELF,arg1,arg4,arg3,arg2)
  135.     ))
  136. ),(
  137.     #(SELF,arg3,arg2,arg1,arg4)
  138. ))[*]
  139.  
  140.  
  141. Name:Fkill-rectangle-do
  142. Called with arg1 = top, arg2 = left, arg3 = bot, arg4 = right.
  143. [*]#(Frectangle-do,(
  144.     ##(rm,0)
  145.     #(Floop, ,##(--,##(--,(arg4),(arg2)),##(nc,##(rm,0))))(
  146. )
  147.     #(dm,0)
  148. ),(arg1),(arg2),(arg3),(arg4))[*]
  149.  
  150.  
  151. Name:Fopen-rectangle-do
  152. Called with arg1 = top, arg2 = left, arg3 = bot, arg4 = right.
  153. [*]#(Frectangle-do,(
  154.     #(Fpad-to-column,(arg4))
  155. ),(arg1),(arg2),(arg3),(arg4))[*]
  156.  
  157.  
  158. Name:Frectangle
  159. do
  160. Called with arg1 = actions for each row,
  161. arg2 = top, arg3 = left, arg4 = bot, arg5 = right.
  162. [*]#(pm,1)
  163. #(ds,corners,#(Fcorners))
  164. #(F(arg1)-rectangle-do,#(corners))
  165. #(es,corners)
  166. #(pm)[*]
  167.  
  168.  
  169. Name:Frectangle-do
  170. Called with arg1 = actions for each row,
  171. arg2 = top, arg3 = left, arg4 = bot, arg5 = right.
  172. [*]#(sv,cl,(arg2))#(sv,cs,(arg5))
  173. #(sm,0)#(sv,cs,(arg3))
  174. arg1
  175. #(==,(arg2),(arg4),,(
  176.     #(SELF,(arg1),#(++,(arg2),1),(arg3),(arg4),(arg5)))
  177. ))[*]
  178.  
  179.  
  180. Name:Fyank-rectangle-do
  181. [*]#(==,##(rectangle-buffer),,(
  182.     #(rs,rectangle-buffer)
  183. ),(
  184.     #(sv,cs,##(column))
  185.     #(Fpad-to-column,##(column))
  186.     #(is,##(fm,rectangle-buffer,(
  187. )))
  188.     #(sp,$)
  189.     #(==,##(rc,>),0,(
  190.         #(Fcrlf)
  191.     ),(
  192.         #(sp,>)
  193.     ))
  194.     #(SELF)
  195. ))[*]